<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #outer {
            width: 100%;
            height: 30px;
            position: relative;
            background-color: #ddd;
        }

        #inner {
            background-color: #4CAF50;
            width: 10px;
            height: 30px;
            position: absolute;
        }
    </style>

</head>
<body>
    <h1>进度条</h1>
    <div id="outer">
        <div id="inner">

        </div>
    </div>
    <input type="button" onclick="move()" value="点我">
</body>
    <script>
        function move() {
            elem = document.getElementById("inner");
            width = 0;
            t = setInterval(frame,100);
            function frame() {
                if (width==100){
                    clearInterval(t);
                }
                else {
                    width++;
                    elem.style.width = width + "%";
                }

            }

        }
    </script>
</html>